<template>
	<view class="page">
		<view class="bodys">
			<view class="yh" v-for="(item,index) in dataList" :key="item.index"
				:style="item.id == 0?'background-color: #eb6668;':item.id == 1?'background-color:#2198C8;':'background-color:#14BB60;'">
				<view class="justify-content-sp">
					<view class="yh_left">
						{{item.id==0?'银行账户':item.id==1?'支付宝账户':'微信账户 (暂不支持)'}}
					</view>
					<view class="yh_right" @click="toPath(item.id)">
						<image src="../../static/account/bianji.png" mode="" class="image"></image>
					</view>
				</view>
				<view class="yh_cont justify-content-start" v-if="item.id== 1||item.id == 0">
					<view class="">
						姓名 ：
					</view>
					<view class="">
						{{item.name}}
					</view>
				</view>
				<view class="yh_cont justify-content-start" v-if="item.id == 0">
					<view class="">
						所属银行 ：
					</view>
					<view class="">
						{{item.bank}}
					</view>
				</view>
				<view class="yh_cont justify-content-start" v-if="item.id== 1||item.id == 0">
					<view class="">
						{{item.id==0?'银行账号':'支付宝账号'}} ：
					</view>
					<view class="yh_cont_right">
						{{item.Number}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isEnroll: 0,
				dataList: [{
						id: 0,
						name: '张三',
						Number: '6214 **** **** 8899',
						bank: '工商银行'
					},
					{
						id: 1,
						name: '张三',
						Number: '147 **** 5678',
						bank: ''
					},
					{
						id: 2,
						name: '',
						Number: '',
						bank: ''
					}
				]
			}
		},
		onLoad() {

		},
		methods: {
			// 跳转页面
			toPath(e) {
				if (e == 2) {
					return
				}
				if (this.dataList[e].name) {
					this.isEnroll = 1;
				}
				console.log(123, this.isEnroll);
				uni.navigateTo({
					url: '/pages/bank/index?type=' + e + '&isEnroll=' + this.isEnroll
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		height: 100%;

		.bodys {

			.yh {
				margin: 30rpx;
				padding: 30rpx;
				color: white;
				border-radius: 15rpx;

				.yh_left {
					font-weight: 550;
					font-size: 18px;
				}

				.yh_right {
					width: 14px;
					height: 14px;


					.image {
						width: 100%;
						height: 100%;
					}
				}

				.yh_cont {
					line-height: 20px;
					padding: 10rpx 0;

					.yh_cont_right {
						font-size: 25px;
					}

				}
			}
		}
	}
</style>